package com.jtbd.controller;

import com.jtbd.dto.OrgCreateHttpDto;
import com.jtbd.dto.result.ResponseBaseData;
import com.jtbd.service.OrgManagementService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/org")
@Tag(name = "机构管理")
public class OrgManagementController {
    @Resource
    private OrgManagementService orgManagementService;

    @PostMapping("/add")
    @Operation(summary = "添加机构")
    public ResponseBaseData<String> add(@RequestBody OrgCreateHttpDto orgCreateHttpDto) {
        Long orgId = orgManagementService.addOrganization(orgCreateHttpDto);
        return ResponseBaseData.success("添加机构成功");
    }
}
